package com.wwl.cms.utils.designModeTest.observer.improve;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/9/13 19:55
 * @description:
 */
public class Client {
    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();
        CurrentConditions currentConditions =new CurrentConditions();
        BaiduSite baiduSite = new BaiduSite();
        weatherData.registerObserver(currentConditions);
        weatherData.registerObserver(baiduSite);

        System.out.println("通知各个注册的观察者，看看信心");
        weatherData.setData(10f,100f,30.3f);
        weatherData.removeObserver(currentConditions);
        System.out.println("通知观察者看信息");
        weatherData.setData(14f,103f,34.3f);

    }
}
